<template>
  <van-popup v-model="is_show">
    <van-action-sheet v-model="show" :actions="actions" @select="onSelect" />
  </van-popup>
</template>

<script>
export default {
  props:{
    show:{
      type: Boolean,
    },
    list: {
      type: Array,
    }
  },
  data(){
    return{
      is_show: false,
      actions: [],
    }
  },
  created(){
    this.actions = this.list;
  },
  watch: {
      show(newVal) {
        this.is_show = newVal;
      },
      is_show(newVal) {
        this.$emit('update:show', newVal)
      }
  },
  methods:{
    onSelect(item){
      this.is_show = false;
      this.$emit('update:value', item);
    },
  }
}
</script>

<style>

</style>